{% extends "base.html" %}

{% block head %}
{{ super() }}

{% assets "css_blog" %}
<link rel="stylesheet" href="{{ ASSET_URL }}" type="text/css" />
{% endassets %}


{% endblock %}

{% block body_left %}
{{ super() }}
{% endblock %}

{% block body_right %}
<div class="center_container">
  <div class="blog_container">
    <div class="blog_layout">
      <div class="blog_content">
        <a href="/blog/{{ blog._id }}"><h1>{{ blog.title }}</h1></a>
        <div class="tags_layout">
          <span class="span_cate">{{ blog.category }}</span>
          {% for tag in blog.tags %}
          <span class="span_tag">{{ tag }}</span>
          {% endfor %}
          {% if current_user.is_active() %}
          <div class="blog_admin">
            <!--<span class="span_tag">{{ current_user.id }}</span>-->
            <a href="/admin/edit/{{ blog._id }}" >编辑</a>
            <button bid="{{ blog._id }}" onclick="base.delete_blog(this)">删除</button>
          </div>
          {% endif %}
        </div>
        <blockquote><p>{{ blog.brief }}</p></blockquote>
        <span class="span_normal">Write:{{ blog.pub_date.strftime("%Y-%m-%d %H:%M") }}</span>
        <span class="span_normal">Modify:{{ blog.mod_date.strftime("%Y-%m-%d %H:%M") }}</span>
        <span class="span_normal">{{ blog.read_count }}次围观</span>
        <span class="span_normal">{{ blog.comments_count }}次讨论</span>
        <span class="span_normal" id="span_love" style="display: none;" bid="{{blog._id}}" onclick="base.love(this)">{{ blog.love_count }}次点赞</span>
        <div class="blog_spacer"></div>
      </div>
      <div class='html_code'>
          {{ blog.html_code|safe }}
      </div>
      <div class="markdown_layout">
        <div id="markdown">{{ blog.content }}</div>
      </div>
      <div class="copyright">
        <p>原文链接: <a href="/blog/{{blog._id}}">http://www.cosven.com/blog/{{blog._id}}</a></p>
      </div>
      
    </div>

  </div>
</div>
<script>
  $('#markdown').html(marked($("#markdown").text()));
  $('pre code').each(function(i, block) {
    hljs.highlightBlock(block);
  });
</script>

{% endblock %}
